 <%@query = sanitize(@query) %>

<h2>Search results </h2>

<p>
<%=@articles.length-%> matche(s) has been found for <%= highlight (h(@query), @query, highlighter = '<strong class="highlight">\1</strong>') %>
</p>

<div>
<%= flash[:notice] %>
</div>

<div style="font-size: small">
  <table class="list_article_sources">
  <% for article in @articles %>
  <% #if  article.readable_from(Time.now()).length > 0 %>
    <tr >
      <td ><%= highlight (h(article.title), @query, highlighter = '<strong class="highlight">\1</strong>'  ) -%></td>
      <td ><%=h article.updated_at.strftime(" %B-%d-%Y ") %></td>
      <td><%=highlight (h(article.author), @query, highlighter = '<strong class="highlight">\1</strong>') %></td>
      <td ><%#highlight (h(article.blurb), @query, highlighter = '<strong class="highlight">\1</strong>' )%></td>
  
      <td>
      <% for section in article.readable_from(Time.now())%>
  
        <%= link_to_article ('Read' , section.issue, section.name, article) %>
  
      <% end %>
      </td>
  
      
    </tr>
    <%#end%>
    <% end %>
  </table>
</div>